<?php
namespace Home\Model;
use Think\Model;
class DeviceDriveModel extends Model {
    public function getDeviceDriveList($cond=null){
    	$res = M('device_drive')->join('drive on device_drive.drive_id = drive.drive_id')->where($cond)
    		->select();
    	return $res;
    }
    
    public function insertDeviceDriveList($data){
    	if(!$data){
    		return false;
    	}
    	$res = M('device_drive')->addAll($data);
    	return $res;
    }
    
    public function removeDeviceDriveList($cond){
    	if(!$cond){
    		return false;
    	}
    	$res = M('device_drive')->where($cond)->delete();
    	return $res;
    }
    
    public function getDeviceDriveInfo($cond){
    	if(!$cond){
    		return false;
    	}
    	$res = M('device_drive')->where($cond)
    		->find();
    	return $res;
    }
    
    public function reviseDeviceDriveInfo($cond,$data){
    	if(!$cond || !$data){
    		return false;
    	}
    	$res = M('device_drive')->where($cond)
    		->save($data);
    	return $res;
    
    	
    }
}